package com.itheima.string;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Demo2 {
    public static void main(String[] args) throws ParseException {
        StringBuilder sb = new StringBuilder("i").append("an").append("aboy");
        System.out.println(sb.toString());

        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

        Date date = new Date();

        String format = df.format(date);
        System.out.println(format);

        String ss="2021年12月6日 08:59:50";
        SimpleDateFormat df2 = new SimpleDateFormat("yyyy年MM月dd日 hh:mm:ss");
        Date parse = df2.parse(ss);

        String format1 = df.format(parse);
        System.out.println(format1);


    }
}
